package cn.cau.epidemicsurveysystem.config;

import cn.cau.epidemicsurveysystem.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class LoginWebMVCConfigurer implements WebMvcConfigurer {
    @Resource
    LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/*")
                .excludePathPatterns("/")        //登录get页面
                .excludePathPatterns("/login")   //登录post页面
                .excludePathPatterns("/error")
                .excludePathPatterns("/wechat*");
    }
}
